﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class ListEx
{
    public static void GrowIfMust<T>(this List<T> list,int newCount)
    {
        int minimuSize = list.Count + newCount;

        if(minimuSize > list.Capacity)
        {
            list.Capacity = Math.Max(Math.Max(list.Capacity * 2, 4),minimuSize);
        }
    }
}
